<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/10/30
 * Time: 18:35
 */

namespace App\Http\Controllers;
use App\Common\Config;
use Illuminate\Support\Facades\Input;
use Laravel\Lumen\Routing\Controller;
class BaseController extends Controller
{
    protected $Page = 0;
    protected $PageNum = 10;

    function __construct(){
    }

    function return_json($code='',$msg='',$result=array()){
        $return_array = array();
        $return_array["error"] = $code;
        $return_array["msg"] = $msg;

        if ($result && !empty($result)) {
            $return_array = array_merge($return_array, $result);
        }

        return response()->make(json_encode($return_array));
    }

    function getPage(){
        return Input::get("Page",$this->Page);
    }
    function getPageNum(){
        return Input::get("PageNum",$this->PageNum);
    }


}